import 'package:flutter/material.dart';

class SearchPage extends StatelessWidget {
  final Map arguments;
  SearchPage({this.arguments});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('搜索'),
      ),
      body: Column(
        children: <Widget>[
          Text('接收到的参数${arguments!=null?arguments['id']:0}'),
          RaisedButton(
            child: Text('返回上一页'),
            onPressed: () {
              Navigator.of(context).pop();
            },
          ),
          RaisedButton(
            child: Text('商品详情页'),
            color: Colors.deepOrange,
            textColor: Colors.white,
            onPressed: () {
              Navigator.pushNamed(context, '/productDetails', arguments: {
                'pid': 456
              });
            },
          )
        ],
      ),
    );
  }
}
